<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title>src/vfs/extfs/helpers/uarc.in</title>
<meta name='robots' content='noindex,nofollow' />
<meta name='generator' content='GLOBAL-6.5.7' />
<meta http-equiv='Content-Style-Type' content='text/css' />
<link rel='stylesheet' type='text/css' href='../style.css' />
</head>
<body>
<!-- beginning of fixed guide -->
<div id='guide'><ul>
<li><a href='#TOP'><img class='icon' src='../icons/first.png' alt='[^]' /></a></li>
<li><a href='#BOTTOM'><img class='icon' src='../icons/last.png' alt='[v]' /></a></li>
<li><a href='#TOP'><img class='icon' src='../icons/top.png' alt='[top]' /></a></li>
<li><a href='#BOTTOM'><img class='icon' src='../icons/bottom.png' alt='[bottom]' /></a></li>
<li><a href='../mains.html'><img class='icon' src='../icons/index.png' alt='[index]' /></a></li>
<li><a href='../help.html'><img class='icon' src='../icons/help.png' alt='[help]' /></a></li>
<li class='standout'><span><a href='../files/src.html'>src</a>/<a href='../files/src--vfs.html'>vfs</a>/<a href='../files/src--vfs--extfs.html'>extfs</a>/<a href='../files/src--vfs--extfs--helpers.html'>helpers</a>/uarc.in</span></li>
</ul></div>
<!-- end of fixed guide -->
<a id='TOP' name='TOP'></a><h2 class='header'><a href='../mains.html'>root</a>/<a href='../files/src.html'>src</a>/<a href='../files/src--vfs.html'>vfs</a>/<a href='../files/src--vfs--extfs.html'>extfs</a>/<a href='../files/src--vfs--extfs--helpers.html'>helpers</a>/uarc.in</h2>
<em class='comment'>/* <img class='icon' src='../icons/n_left.png' alt='[previous]' /><img class='icon' src='../icons/n_right.png' alt='[next]' /><img class='icon' src='../icons/n_first.png' alt='[first]' /><img class='icon' src='../icons/n_last.png' alt='[last]' /><img class='icon' src='../icons/n_top.png' alt='[top]' /><a href='#BOTTOM'><img class='icon' src='../icons/bottom.png' alt='[bottom]' /></a><a href='../mains.html'><img class='icon' src='../icons/index.png' alt='[index]' /></a><a href='../help.html'><img class='icon' src='../icons/help.png' alt='[help]' /></a>&nbsp;<input type='text' readonly onfocus='this.select();' value='+1 src/vfs/extfs/helpers/uarc.in'  /> */</em>
<hr />
<pre>
<a id='L1' name='L1'></a>#! /bin/sh
<a id='L2' name='L2'></a> 
<a id='L3' name='L3'></a>#
<a id='L4' name='L4'></a># ARC Virtual filesystem executive
<a id='L5' name='L5'></a># Copyright (C) 2008 Jacques Pelletier
<a id='L6' name='L6'></a># May be distributed under the terms of the GNU Public License
<a id='L7' name='L7'></a># &lt;jpelletier@ieee.org&gt;
<a id='L8' name='L8'></a>#
<a id='L9' name='L9'></a> 
<a id='L10' name='L10'></a># Define which archiver you are using with appropriate options
<a id='L11' name='L11'></a>ARC_LIST=${MC_TEST_EXTFS_LIST_CMD:-"arc v"}
<a id='L12' name='L12'></a>ARC_GET="arc x"
<a id='L13' name='L13'></a>ARC_PUT="arc a"
<a id='L14' name='L14'></a>ARC_DEL="arc d"
<a id='L15' name='L15'></a> 
<a id='L16' name='L16'></a># The 'list' command executive
<a id='L17' name='L17'></a> 
<a id='L18' name='L18'></a>mc_arc_fs_list()
<a id='L19' name='L19'></a>{
<a id='L20' name='L20'></a>    if [ "x$UID" = "x" ]; then
<a id='L21' name='L21'></a>        UID=`id -ru 2&gt;/dev/null`
<a id='L22' name='L22'></a>        if [ "x$UID" = "x" ]; then
<a id='L23' name='L23'></a>            UID=0
<a id='L24' name='L24'></a>        fi
<a id='L25' name='L25'></a>    fi
<a id='L26' name='L26'></a>    $ARC_LIST "$1" | @AWK@ -v uid=$UID '
<a id='L27' name='L27'></a>BEGIN {
<a id='L28' name='L28'></a>  # Copied from uzoo.in.
<a id='L29' name='L29'></a>  split("Jan:Feb:Mar:Apr:May:Jun:Jul:Aug:Sep:Oct:Nov:Dec", month_list, ":")
<a id='L30' name='L30'></a>  for (i=1; i&lt;=12; i++) {
<a id='L31' name='L31'></a>    month[month_list[i]] = i
<a id='L32' name='L32'></a>  }
<a id='L33' name='L33'></a>}
<a id='L34' name='L34'></a>/^Name/ { next }
<a id='L35' name='L35'></a>/===/ { next }
<a id='L36' name='L36'></a>/^Total/ { next }
<a id='L37' name='L37'></a>{
<a id='L38' name='L38'></a>        if ($8 &gt; 50)
<a id='L39' name='L39'></a>        $8=$8 + 1900
<a id='L40' name='L40'></a>        else
<a id='L41' name='L41'></a>        $8=$8 + 2000
<a id='L42' name='L42'></a> 
<a id='L43' name='L43'></a>        split($9, a, ":")
<a id='L44' name='L44'></a> 
<a id='L45' name='L45'></a>        # convert AM/PM to 00-23
<a id='L46' name='L46'></a>        if (a[2] ~ /a$|p$/)
<a id='L47' name='L47'></a>        {
<a id='L48' name='L48'></a>                if (a[2] ~ /p$/)
<a id='L49' name='L49'></a>                        a[1] = a[1]+12
<a id='L50' name='L50'></a> 
<a id='L51' name='L51'></a>                a[2]=substr(a[2],1,2)
<a id='L52' name='L52'></a>        }
<a id='L53' name='L53'></a> 
<a id='L54' name='L54'></a>        printf "-rw-r--r--   1 %-8d %-8d %8d %02d-%02d-%04d %02d:%02d %s\n", uid, 0, $2, month[$7], $6, $8, a[1], a[2], $1
<a id='L55' name='L55'></a>}' 2&gt;/dev/null
<a id='L56' name='L56'></a>    exit 0
<a id='L57' name='L57'></a>}
<a id='L58' name='L58'></a> 
<a id='L59' name='L59'></a># Command: copyout archivename storedfilename extractto
<a id='L60' name='L60'></a>mc_arc_fs_copyout()
<a id='L61' name='L61'></a>{
<a id='L62' name='L62'></a>   $ARC_GET "$1" "$2" 2&gt; /dev/null
<a id='L63' name='L63'></a>        mv "$2" "$3"
<a id='L64' name='L64'></a>}
<a id='L65' name='L65'></a> 
<a id='L66' name='L66'></a># Command: copyin archivename storedfilename sourcefile
<a id='L67' name='L67'></a>mc_arc_fs_copyin()
<a id='L68' name='L68'></a>{
<a id='L69' name='L69'></a>        mv "$3" "$2"
<a id='L70' name='L70'></a>        $ARC_PUT "$1" "$2" 2&gt; /dev/null
<a id='L71' name='L71'></a>}
<a id='L72' name='L72'></a> 
<a id='L73' name='L73'></a># Command: rm archivename storedfilename
<a id='L74' name='L74'></a>mc_arc_fs_rm()
<a id='L75' name='L75'></a>{
<a id='L76' name='L76'></a>        $ARC_DEL "$1" "$2" 2&gt; /dev/null
<a id='L77' name='L77'></a>}
<a id='L78' name='L78'></a> 
<a id='L79' name='L79'></a># The main routine
<a id='L80' name='L80'></a>umask 077
<a id='L81' name='L81'></a> 
<a id='L82' name='L82'></a>cmd="$1"
<a id='L83' name='L83'></a>shift
<a id='L84' name='L84'></a> 
<a id='L85' name='L85'></a>case "$cmd" in
<a id='L86' name='L86'></a>   list)        mc_arc_fs_list    "$@" ;;
<a id='L87' name='L87'></a>   copyout) mc_arc_fs_copyout "$@" ;;
<a id='L88' name='L88'></a>   copyin)      mc_arc_fs_copyin  "$@" ;;
<a id='L89' name='L89'></a>   rm)          mc_arc_fs_rm      "$@" ;;
<a id='L90' name='L90'></a>   *)       exit 1 ;;
<a id='L91' name='L91'></a>esac
<a id='L92' name='L92'></a>exit 0
</pre>
<hr />
<a id='BOTTOM' name='BOTTOM'></a>
<em class='comment'>/* <img class='icon' src='../icons/n_left.png' alt='[previous]' /><img class='icon' src='../icons/n_right.png' alt='[next]' /><img class='icon' src='../icons/n_first.png' alt='[first]' /><img class='icon' src='../icons/n_last.png' alt='[last]' /><a href='#TOP'><img class='icon' src='../icons/top.png' alt='[top]' /></a><img class='icon' src='../icons/n_bottom.png' alt='[bottom]' /><a href='../mains.html'><img class='icon' src='../icons/index.png' alt='[index]' /></a><a href='../help.html'><img class='icon' src='../icons/help.png' alt='[help]' /></a>&nbsp;<input type='text' readonly onfocus='this.select();' value='+92 src/vfs/extfs/helpers/uarc.in'  /> */</em>
</body>
</html>
